﻿//*公共的用户控件类
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using WebUI.Helper;
using System.Web;
using System.ComponentModel.DataAnnotations;
namespace WebUI.Con
{
    public class UserCtrlController : Controller
    {
        /// <summary>
        /// 选择桌号的用户控件
        /// </summary>
        /// <returns></returns>
        public ActionResult CreditSaleSetup()
        {
            var Cr = OperateContext.Current.BLLSession.ICreditSetupBLL.GetListBy(s =>s.IsUsed==false).Select(s => new Model.ViewModel.CreditSetup()
            {
                CreditID = s.CreditID,
                CreditName = s.CreditName
            }).ToList();
            return PartialView(Cr);
        }

        public ActionResult CreditSale()
        {
           
            
            var CreditSale = OperateContext.Current.BLLSession.ICreditSaleBLL.GetListBy(s => s.IsCheck == false).Select(s => new Model.ViewModel.CreditSale()
            {
                
                CreditSaleNOID = s.CreditSaleNOID,
                CreditSetupName=s.CreditSetup.CreditName,
                CreditSetupID=s.CreditSetup.CreditID,
                SaleUserName = s.UserDB.NickName,
                CreditSaleBeginTime = (s.CreditSaleBeginTime ?? DateTime.Now).ToString("yy年MM月dd日hh时mm分"),
                CheckMoney = s.CheckMoney ?? 0
            }).ToList();

            return PartialView(CreditSale);
        }
    }
}
